package ie.lawlor.amvc;

import ie.lawlor.amvc.event.EventName;

import org.springframework.beans.BeansException;
import org.springframework.context.support.ClassPathXmlApplicationContext;



public class AmvcApplicationContext extends ClassPathXmlApplicationContext  {

	private static final String RESOURCE_PATTERNS[]= {
		"classpath*:**/application.xml",
		"classpath*:/**/triad.xml",
		"classpath*:/**/*Triad.xml",
		"classpath*:/**/amvc.xml"
		};

	public AmvcApplicationContext() throws BeansException {
		super(RESOURCE_PATTERNS);
	}

	public EventName getEventName(String eventId) {
		return (EventName)getBean(eventId);
	}

	public Triad getMainTriad(){
		return (Triad)getBean("application");
	}
}
